import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit";

import counterSlice from "./counter/couterSlice";
import listSlice from "./list/listSlice";
import userSlice from "./user/userSlice";

export const store = configureStore({
  reducer: {
    count: counterSlice.reducer,
    list: listSlice.reducer,
    user: userSlice.reducer,
  },
});

export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
  ReturnType,
  RootState,
  unknown,
  Action<string>
>;
